package lambda.apple.v7;

import java.util.ArrayList;
import java.util.List;

public class App {

	public static void main(String[] args) {
		List<Apple> list = getApple();
		list.stream()
				.filter(a -> a.getWeight() == 100)
				.sorted((a, b) -> a.getColor().length() - b.getColor().length())
				.forEach(System.out::println);
	}

	private static List<Apple> getApple() {
		List<Apple> list = new ArrayList<Apple>();
		list.add(new Apple("blue", 100));
		list.add(new Apple("red", 100));
		list.add(new Apple("red", 200));
		list.add(new Apple("green", 100));
		list.add(new Apple("green", 200));
		return list;
	}

}